<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            /* 
                四舍五入
            */
            console.log("Math.round(5.6)", Math.round(5.6));
            console.log("Math.round(5.4)", Math.round(5.4));

            /* 
                向上取整
            */
            console.log("Math.ceil(5.1)", Math.ceil(5.1));
            console.log("Math.ceil(5.56)", Math.ceil(5.56));

            /* 
                向下取整
            */
            console.log("Math.floor(5.8)", Math.floor(5.8));

            /* 
                次方
            */
            console.log("Math.pow(2, 3)", Math.pow(2, 3));

            /* 
                平方根
            */
            console.log("Math.sqrt(9)", Math.sqrt(9));

            /* 
                绝对值
            */
            console.log("Math.abs(-100)", Math.abs(-100));

            /* 最大最小值 */

            let a = 99;
            let b = 88;

            console.log("Math.max(a,b)", Math.max(a, b));
            console.log(
                "Math.max(87,90,54,31,100)",
                Math.max(87, 90, 54, 31, 100)
            );
            console.log(
                "Math.min(23,43,45,34,12)",
                Math.min(23, 43, 45, 34, 12)
            );
        </script>
    </body>
</html>
